<style>
.venue_salse{
	width: 111px!important;
    text-decoration: none!important;
    font-weight: bold!important;
}
.fieldlist dd ins {
    width: 111px!important;
 
}
</style>
<form id="add-form" class="form-horizontal callback" role="form" data-toggle="validator" method="POST" action="" autocomplete="off">
	<div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">组合定价信息:</label>
        <div class="col-xs-12 col-sm-8">
		   <dl class="fieldlist" data-name="data[type]" data-template="venue_tpl" id="questionDL">
				<dd>
					<ins>单科定价</ins>
					<ins>单科数量</ins>
				</dd>
				<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
				<textarea name="data[type]" id="pricing_data" class="form-control pricing_data hide" cols="30" rows="5"></textarea>
			</dl>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
         
        </div>
    </div>
</form>
<script type="text/html" id="venue_tpl">
    <dd class="form-inline" >
	    <select class="form-control venue_salse pricing_price_<%=index%>"   name="data[type][<%=index%>][pricing_price]" >
		 {foreach name="$WeekInfo['RoundInfo']['Pricing_price']" key="Pricing_price" item="pricing_price_vo"}
			<option value="{$pricing_price_vo}"  >{$pricing_price_vo}</option>
		 {/foreach}
		</select>
		<input type="text"  class="form-control venue_salse  pricing_price_name_<%=index%> hide " value="<%=row.value.pricing_price%>" size="10"> 
		<input type="text" name="data[type][<%=index%>][round_num]"  class="form-control venue_salse  round_num_<%=index%>" value="<%=row.value.round_num%>" size="10"> 
		<span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> 
		<span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
    </dd>
</script>
<script type="text/javascript">
window.onload=function(){

	setTimeout(function(){
		var temp = document.getElementById('questionDL');
  	    var num = temp.getElementsByTagName("dd").length
	   if(num > 0){
		for (var i=0;i<num-2 ;i++ ){
			console.log(1111);
			//定价类型
			var pricing_price1 = document.querySelector('.pricing_price_name_'+i).value;
			var pricing_price1_select = document.querySelector('.pricing_price_'+i);
			for(var a=0; a<pricing_price1_select.options.length; a++){  
				if(pricing_price1_select.options[a].value == pricing_price1){  
					pricing_price1_select.options[a].selected = true; 
				}
			}
		}
	 }
	},3000); 
	
}

</script>
